home *** CD-ROM | disk | FTP | other *** search
- property pSpriteNum, pStatus, pActive, pCallBackObj, pRefcon
-
- on new me, propList
- set pSpriteNum to getaProp(propList, #sprite)
- set pStatus to getaProp(propList, #cur)
- set pActive to getaProp(propList, #active)
- set pCallBackObj to getaProp(propList, #callback)
- set pRefcon to getaProp(propList, #ref)
- SetUp(me, pStatus)
- SetEnabled(me, pActive)
- return me
- end
-
- on click me, sNum
- if not pActive then
- exit
- end if
- if not integerp(sNum) then
- set sNum to the clickOn
- end if
- if the memberNum of sprite sNum < 1 then
- exit
- end if
- if not (the name of the member of sprite sNum contains "checkBox") then
- exit
- end if
- set memName to the name of the member of sprite sNum
- set the member of sprite sNum to member (memName && "Down")
- updateStage()
- set selected to 1
- repeat while the stillDown
- if rollOver(sNum) then
- set the member of sprite sNum to member (memName && "Down")
- set selected to 1
- else
- set the member of sprite sNum to member memName
- set selected to 0
- end if
- updateStage()
- end repeat
- SetUp(me, not pStatus)
- if objectp(pCallBackObj) then
- checkBox(pCallBackObj, pRefcon, pStatus)
- end if
- return pStatus
- end
-
- on SetUp me, newNum
- set pStatus to newNum
- refresh(me)
- end
-
- on refresh me
- puppetSprite(pSpriteNum, 1)
- if pStatus then
- set the member of sprite pSpriteNum to member "checkBox 1"
- else
- set the member of sprite pSpriteNum to member "checkBox 0"
- end if
- end
-
- on SetEnabled me, enabled
- set pActive to enabled
- end
-
- on Release me
- puppetSprite(pSpriteNum, 0)
- end
-